/*
 * Start.java
 *
 * Created on 2007. m�rcius 25., 15:26
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package lemmingsproto;

/**
 *
 * @author attila
 * A bel�p�si pontot reprezent�l� oszt�ly
 */
public class Start extends FieldProp {
    
    int ttal; //timetoaddlemming;
    
     /** 
     *Konstruktor
     * @param parent
     * A mez�, amihez a tuladjons�g tartozik
     */
    public Start(Field parent) {
        super(parent);
        System.out.println("> new Start()");
        ttal=3;
    }
    /**
    * @return
    * TRUE ha egy lemming r�l�phet erre a mez�re, FALSE egy�bk�nt
    */
    public boolean wannaGo() {
        System.out.println("  > Start.wannaGo() -> true");
        return true;
    }
    /**
     * �j lemminget helyez a p�ly�ra
     */
    public void onMe() {
        if (Lemming.getNum()>0) {

            if (ttal<=0) {
                Lemming.setNum(Lemming.getNum()-1);
                parentField.getLemming(new Lemming());
                ttal=3;
            }
            ttal--;
        }
        return;
    }
    
    public String toString(){
        return "B";
    }
}
